package com.senven.api.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.senven.api.commom.ResponsePage;
import com.senven.api.pojo.Log;
import com.senven.api.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @author LQP
 */
@RequestMapping("/api/log")
@Controller
public class LogController {
    @Autowired
    private LogService logService;

    @GetMapping("/getLogList")
    @ResponseBody
    public ResponsePage<Log> queryLogList(@RequestParam(value = "current",defaultValue = "1") int current,
                                          @RequestParam(value = "size", defaultValue = "10") int size){
        return logService.queryLogList(current,size);
    }

    @GetMapping("/getLogListByName")
    @ResponseBody
    public ResponsePage<Log> queryLogListByName(@RequestParam String name,
                                                @RequestParam(value = "current",defaultValue = "1") int current,
                                                @RequestParam(value = "size",defaultValue = "10")int size){
        return logService.queryLogListByName(name, current, size);
    }



}
